/* ===== ascii.css ===== */
/* Reset & base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #f5f7fb;
  color: #1e293b;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* CrafterTools header/footer styles (preserved) */
.crafter-header {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  padding: 0.75rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  font-size: 1.4rem;
  color: #2563eb;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo i {
  font-size: 1.6rem;
}
.crafter-header nav ul {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}
.crafter-header nav a {
  text-decoration: none;
  color: #475569;
  font-weight: 500;
  transition: color 0.2s;
}
.crafter-header nav a:hover {
  color: #2563eb;
}
.crafter-footer {
  text-align: center;
  padding: 1.5rem;
  color: #64748b;
  font-size: 0.9rem;
  border-top: 1px solid #e2e8f0;
  margin-top: 2rem;
}

/* Main tool area */
.crafter-main {
  flex: 1;
  padding: 2rem 1.5rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.tool-card {
  background: #ffffff;
  border-radius: 2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  padding: 2rem;
  transition: box-shadow 0.3s;
}

.tool-title {
  font-size: 1.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.privacy-badge {
  background: #eef2ff;
  color: #2563eb;
  padding: 0.6rem 1rem;
  border-radius: 3rem;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 1.5rem;
  background: #f8fafc;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 2rem;
}
.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: #2563eb;
  background: #eff6ff;
  outline: none;
}
.drop-zone i {
  font-size: 2.5rem;
  color: #2563eb;
  margin-bottom: 0.5rem;
}
.drop-zone p {
  color: #334155;
  font-weight: 500;
}
.browse-link {
  color: #2563eb;
  text-decoration: underline;
  cursor: pointer;
}
.small-note {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 0.4rem;
}

/* Workspace grid */
.workspace {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.section-label {
  font-size: 1rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.75rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Preview */
.preview-panel {
  display: flex;
  flex-direction: column;
}
.preview-container {
  background: #f1f5f9;
  border-radius: 1.5rem;
  padding: 1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 1;
}
#originalPreview {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 1rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
}
.preview-placeholder i {
  font-size: 2.5rem;
}

/* Controls */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
}
.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.control-item label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
  display: flex;
  justify-content: space-between;
}
.control-item input[type="range"] {
  width: 100%;
  accent-color: #2563eb;
  height: 6px;
  border-radius: 3px;
}
.toggle-item {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.toggle-item label:first-child {
  font-size: 0.85rem;
  font-weight: 500;
  color: #334155;
}

/* Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .2s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .2s;
  border-radius: 50%;
}
input:checked + .slider {
  background-color: #2563eb;
}
input:checked + .slider:before {
  transform: translateX(22px);
}

/* Control row */
.control-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.5rem;
  align-items: end;
}
.control-row select,
.control-row input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.75rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  font-size: 0.9rem;
  color: #1e293b;
  transition: border 0.2s;
}
.control-row select:focus,
.control-row input:focus {
  border-color: #2563eb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Buttons */
.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}
.btn {
  padding: 0.7rem 1.2rem;
  border-radius: 2rem;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  border: 1px solid #e2e8f0;
}
.btn:hover {
  background: #f8fafc;
  transform: translateY(-1px);
}
.btn.primary {
  background: #2563eb;
  color: #ffffff;
  border: none;
}
.btn.primary:hover {
  background: #1d4ed8;
}
.btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Output area */
.output-section {
  display: flex;
  flex-direction: column;
}
.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.stats {
  font-size: 0.8rem;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.7rem;
  border-radius: 2rem;
}
.ascii-output {
  width: 100%;
  min-height: 240px;
  max-height: 400px;
  padding: 1rem;
  border-radius: 1.5rem;
  border: 1px solid #e2e8f0;
  background: #0f172a;
  color: #e2e8f0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 10px;
  line-height: 1.1;
  resize: vertical;
  overflow: auto;
  white-space: pre;
  tab-size: 4;
  letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .control-grid,
  .control-row {
    grid-template-columns: 1fr;
  }
  .tool-card {
    padding: 1.5rem;
  }
  .tool-title {
    font-size: 1.6rem;
  }
}
@media (max-width: 600px) {
  .crafter-main {
    padding: 1rem;
  }
  .tool-card {
    padding: 1.25rem;
    border-radius: 1.5rem;
  }
  .button-group .btn {
    flex: 1 1 100%;
    justify-content: center;
  }
  .crafter-header nav ul {
    gap: 0.8rem;
  }
  .logo {
    font-size: 1.2rem;
  }
  .ascii-output {
    font-size: 8px;
  }
}

/* Utility */
.hidden {
  display: none !important;
}